package com.corgi.sharding.controller;

import com.corgi.sharding.entity.User;
import com.corgi.sharding.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @title: UserController
 * @description:
 * @author: dengmiao
 * @create: 2019-10-09 10:46
 **/
@RestController
public class UserController {

	@Autowired
	private UserService userService;

	@GetMapping("/retrieve")
	public List<User> retrieve() {
		return userService.list();
	}

	@GetMapping("/create")
	public Boolean create(User user) {
		return userService.save(user);
	}
}
